﻿using System;
using diantou.examDataAccess;

namespace diantou.web.enterprise
{
    /// <summary>
    /// 独占题目集合
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPage = false, IsPool = true)]
    partial class privateProblemList : examPermissionView<privateProblemList>
    {
        /// <summary>
        /// 题目集合
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private diantou.examDataAccess.examProblem[] problems;
        /// <summary>
        /// 编程题价格(单位:元)
        /// </summary>
        private int price = diantou.examDataAccess.examProblem.SetEnterprisePrice / 100;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="page"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        private bool loadView(int page, diantou.dataAccess.problem.showType showType, diantou.examDataAccess.examQuestion.sort sort, bool isAsc)
        {
            if (currentUser.Permission == dataModel.user.permission.Admin || currentEnterprise.IsEnterprisePrivateValidity)
            {
                problems = clientCache.ExamProblem.Get(diantou.examDataAccess.tcpCall.examProblem.getPrivateIds(currentUser.Id, currentUser.IsChangeVisit, showType, sort, isAsc, pageInfo.Size = fastCSharp.config.pub.Default.PageSize, pageInfo.Page = page, out pageInfo.Count));
                return true;
            }
            AjaxResponse(webConfig.NotFound404);
            return false;
        }
    }
}
